package ihm;

import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextField;

import metier.Employe;

import test.MenuPrincipal;

public class FenetreConnexion extends JDialog implements ActionListener
{
	private Container contenu;
	private JButton bInscrire;
	private JButton bConnexion;
	private JTextField txtIdentifiant;
	private JLabel lblIdentifiant;
	private JTextField txtPassword;
	private JLabel lblPassword;
	
	public FenetreConnexion () 
	{		
		lblIdentifiant = new JLabel("Identifiant :");
		txtIdentifiant = new JTextField ();
		lblPassword = new JLabel("Mot de passe :");
		txtPassword = new JTextField ();
		
		bInscrire = new JButton("S'inscrire");
		bConnexion = new JButton("Connexion");		
		this.contenu = this.getContentPane();
		this.contenu.setLayout(null);
		
		contenu.add(bInscrire);	
	    bInscrire.addActionListener(this); 
	    contenu.add(bConnexion);	
	    bConnexion.addActionListener(this); 
	    
		bInscrire.setBounds(10,80,100,30);
		bConnexion.setBounds(120,80,100,30);
		lblIdentifiant.setBounds(10,10,100,30);
		txtIdentifiant.setBounds(100,10,100,30);
		lblPassword.setBounds(10,40,100,30);
		txtPassword.setBounds(100,40,100,30);
		
		contenu.add(lblIdentifiant);
		contenu.add(txtIdentifiant);
		contenu.add(lblPassword);
		contenu.add(txtPassword);
				
	}
	
	public void actionPerformed(ActionEvent evt)
	{
		// Bouton Annuler
		if(evt.getSource() == bInscrire)
		{
            this.dispose();
		}	
		
		if(evt.getSource() == bConnexion)
		{

		}
	}
}
